package com.example.courseapp.net;

import com.example.courseapp.bean.AddChildInfo;
import com.example.courseapp.bean.AnalyzePojo;
import com.example.courseapp.bean.ChartBean;
import com.example.courseapp.bean.ChildDietaryRecords;
import com.example.courseapp.bean.ChildInformation;
import com.example.courseapp.bean.ChildInformationHis;
import com.example.courseapp.bean.ChildSportRecords;
import com.example.courseapp.bean.FoodBean;
import com.example.courseapp.bean.FoodInfo;
import com.example.courseapp.bean.FoodRemVo;
import com.example.courseapp.bean.HealthAnalyze;
import com.example.courseapp.bean.LoginInfo;
import com.example.courseapp.bean.LoginRsp;
import com.example.courseapp.bean.NewFoodInfo;
import com.example.courseapp.bean.NewRecommendFoodInfo;
import com.example.courseapp.bean.Report;
import com.example.courseapp.bean.Response;
import com.example.courseapp.bean.SportInfo;
import com.example.courseapp.bean.SportRem;
import com.example.courseapp.bean.User;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Query;


public interface CourseService {
    @POST("/user/register")
    public Call<User> register(@Body User student);
    @POST("/user/login")
    public Call<Response<LoginRsp>> login(@Body LoginInfo loginInfo);

    @POST("/user/addChild")
    public Call<Boolean> addChild(@Body AddChildInfo addChildInfo);
    //post get put delete
    @PUT("/childinformationtable")
    public Call<Boolean> changeChildInfo(@Body ChildInformation childInformation);

    @GET("/childinformationtable/his")
    public Call<List<ChildInformationHis>> getChildHis();
    @POST("/user/getChildList")
    public Call<List<ChildInformation>> getChildList(@Body Integer userID);

    @POST("/user/getChildById")
    public Call<ChildInformation> getChildById(@Body Integer childID);

//    @GET("/user/getFoodInfo")
//    public Call<List<FoodInfo>> getFoodInfo();
    @GET("/foodinfo")
    public Call<List<FoodInfo>> getFoodCategory();
    @GET("/foodinfo/getList")
    public Call<List<FoodBean>> getFoodList();

    @GET("/user/getSportInfo")
    public Call<List<SportInfo>> getSportInfo();


    @POST("/user/saveDietaryRecords")
    public Call<Boolean> saveDietaryRecords(@Body ChildDietaryRecords childDietaryRecords);

    @POST("/user/getDietaryList")
    public Call<List<ChildDietaryRecords>> getDietaryList(@Body Integer childID);

    @GET("/childinformationtable/getFoodSuggest2")
    public Call<NewRecommendFoodInfo> getRecommend(@Query("id") Integer id);

    @POST("/user/saveSportRecords")
    public Call<Boolean> saveSportRecords(@Body ChildSportRecords childSportRecords);

    @POST("/user/getSportList")
    public Call<List<ChildSportRecords>> getSportList(@Body Integer childID);

    @POST("/user/getReport")
    public Call<List<Report>> getReport(@Body Integer childID);
    @FormUrlEncoded
    @POST("/report/statistics")
    public Call<ChartBean> getStatistics(@Field("uid") Integer uid);

    @POST("/user/saveReport")
    public Call<Boolean> saveReport(@Body Report report);

    @POST("/health_ana/analyze")
    public Call<HealthAnalyze> analyze(@Body AnalyzePojo analyzePojo);

    @POST("/foodrem/getByBmi")
    public Call<FoodRemVo> getFoodRemByBmi(@Body double nowBmi);

    @POST("/sportrem/getSportRemByCid")
    public Call<SportRem> getSportRemByCid(@Body int childId);

    @POST("/sportrem/getSportRemByBmi")
    public Call<SportRem> getSportRemByBmi(@Body double bmi);
}
